Perl block handler problems

Perl block handler problems

am 06.10.2009 15:23:32 von Kevin Bosak

--00148531a39f01fe7e04754423b3
Content-Type: text/plain; charset=ISO-8859-1

Hi all,
I was trying to set up some perl code to configure my apache server
dynamically and came across this:
http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.htm l#Advanced_API.
Upon trying it out however, I could not get it working correctly. It
seems that the Perl code in the block is getting executed fine, but
there are problems when trying to parse the "handler=xxx" portion of the
opening tag.

For example, if I have it will complain that "Foo" can
not be found in @INC. However, if I leave the quotes off of the module,
, it seems to work fine. Also, the example in the docs
shows the handler method being defined as "sub My::Handler::handler :
handler " which for me gives an error. Though using the ": method"
attribute works.

So, is the handler feature of Perl blocks just not yet working right? Has
anyone else had luck with it? Are the docs incorrect?


mod_perl 2.0.4
apache 2.2.13
perl 5.10.1

Thanks,
Kevin

--00148531a39f01fe7e04754423b3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi all,
=A0 I was trying to set up some perl code to configure my apache=
server dynamically and came across this: /docs/2.0/api/Apache2/PerlSections.html#Advanced_API">http:/ /perl.apache.or=
g/docs/2.0/api/Apache2/PerlSections.html#Advanced_API
.=A0 Upon trying =
it out however, I could not get it working correctly.=A0 It seems that the =
Perl code in the <Perl> block is getting executed fine, but there are=
problems when trying to parse the "handler=3Dxxx" portion of the=
opening tag.


For example, if I have <Perl handler=3D"Foo">=A0 it wil=
l complain that "Foo" can not be found in @INC.=A0 However, if I =
leave the quotes off of the module, <Perl handler=3DFoo>, it seems to=
work fine.=A0 Also, the example in the docs shows the handler method being=
defined as "sub My::Handler::handler : handler " which for me gi=
ves an error.=A0 Though using the ": method" attribute works.


So, is the handler feature of Perl blocks just not yet working right?=
=A0 Has anyone else had luck with it?=A0 Are the docs incorrect?

>mod_perl 2.0.4
apache 2.2.13
perl 5.10.1

Thanks,
Kevin


--00148531a39f01fe7e04754423b3--

Re: Perl block handler problems

am 13.10.2009 16:41:33 von Kevin Bosak

--001485f7258ee9e8e50475d20a1d
Content-Type: text/plain; charset=ISO-8859-1

I don't mean to be a pest but I'd like to further explore using handlers for
Perl sections. Does anyone have any info on this or can point me in another
direction?

I guess I can just put my dynamic configs in a perl module that's not called
as a handler and just 'use' it in the apache config, right? I know I can
put it in a Perl section using the default handler but I'd like to have my
perl code in a separate module and not the apache config.

On Tue, Oct 6, 2009 at 9:23 AM, Kevin Bosak wrote:

> Hi all,
> I was trying to set up some perl code to configure my apache server
> dynamically and came across this:
> http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.htm l#Advanced_API. Upon trying it out however, I could not get it working correctly. It
> seems that the Perl code in the block is getting executed fine, but
> there are problems when trying to parse the "handler=xxx" portion of the
> opening tag.
>
> For example, if I have it will complain that "Foo"
> can not be found in @INC. However, if I leave the quotes off of the module,
> , it seems to work fine. Also, the example in the docs
> shows the handler method being defined as "sub My::Handler::handler :
> handler " which for me gives an error. Though using the ": method"
> attribute works.
>
> So, is the handler feature of Perl blocks just not yet working right? Has
> anyone else had luck with it? Are the docs incorrect?
>
>
> mod_perl 2.0.4
> apache 2.2.13
> perl 5.10.1
>
> Thanks,
> Kevin
>

--001485f7258ee9e8e50475d20a1d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I don't mean to be a pest but I'd like to further explore using han=
dlers for Perl sections.=A0 Does anyone have any info on this or can point =
me in another direction?

I guess I can just put my dynamic configs i=
n a perl module that's not called as a handler and just 'use' i=
t in the apache config, right?=A0 I know I can put it in a Perl section usi=
ng the default handler but I'd like to have my perl code in a separate =
module and not the apache config.


On Tue, Oct 6, 2009 at 9:23 AM, Kevin Bosak =
<philote@gmail.co=
m
>
wrote:
r-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-le=
ft: 1ex;">
Hi all,
=A0 I was trying to set up some perl code to configure my apache=
server dynamically and came across this: /docs/2.0/api/Apache2/PerlSections.html#Advanced_API" target=3D"_blank">htt=
p://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html#A dvanced_API
=
.=A0 Upon trying it out however, I could not get it working correctly.=A0 =
It seems that the Perl code in the <Perl> block is getting executed f=
ine, but there are problems when trying to parse the "handler=3Dxxx&qu=
ot; portion of the opening tag.



For example, if I have <Perl handler=3D"Foo">=A0 it wil=
l complain that "Foo" can not be found in @INC.=A0 However, if I =
leave the quotes off of the module, <Perl handler=3DFoo>, it seems to=
work fine.=A0 Also, the example in the docs shows the handler method being=
defined as "sub My::Handler::handler : handler " which for me gi=
ves an error.=A0 Though using the ": method" attribute works.



So, is the handler feature of Perl blocks just not yet working right?=
=A0 Has anyone else had luck with it?=A0 Are the docs incorrect?

>mod_perl 2.0.4
apache 2.2.13
perl 5.10.1

Thanks,
or=3D"#888888">Kevin





--001485f7258ee9e8e50475d20a1d--